package org.ala.tiktools.rpc.plugin.interceptor;

import java.lang.reflect.Method;
import java.util.Map;

/**
 *	拦截器链
 *	
 *	@author ala
 *	@date 2025年4月23日
 */
public interface IRpcInterceptorChain {
	/**
	 * 	空值
	 */
	public static IRpcInterceptorChain NULL = new IRpcInterceptorChain() {
		public void doInterceptor(Method method, Object[] args, Map<String, Object> metadata) throws Exception {}
		public void afterInterceptor(Method method, Object[] args, Object res, Map<String, Object> metadata) throws Exception {}
		public void append(IRpcInterceptor i) {}
	};
	
	
	/**
	 * 	执行拦截器链
	 * 	@param	others	方法自定义的拦截器组
	 */
	void doInterceptor(Method method, Object[] args, Map<String, Object> metadata) throws Exception;
	/**
	 * 	执行拦截器链
	 * 	@param	others	方法自定义的拦截器组
	 */
	void afterInterceptor(Method method, Object[] args, Object res, Map<String, Object> metadata) throws Exception;
	/**
	 * 	
	 */
	void append(IRpcInterceptor i);
}
